<%if notice%>
  <p id="notice"><%= notice %></p>
<%end%>

<div id="editor_wrapper">
    <iframe class="vishEditorIframe" id="presentation_editor_iframe" src="<%=edit_excursion_path(@excursion, :format => :full)%>" width="1200" height="750" style="border:0" iframeborder="0" frameborder="0" iframeElement.frameBorder=0; webkitAllowFullScreen="true" allowfullscreen="true" mozallowfullscreen="true"></iframe>
    <div id="editor_tools_wrapper">
      <%= render :partial => 'excursions/excursion-tool-tab' %>
    </div>
</div>
 
<%=javascript_include_tag "VISH.IframeAPI" %>

<% content_for :javascript do %>
    function setFavicon(){
      var link = $('link[type="image/vnd.microsoft.icon"]').remove().attr("href");
      $('<link href="'+ link +'" rel="shortcut icon" type="image/x-icon" />').appendTo('head');
    }
        
    //location.href = "#presentation_iframe";
    setFavicon();
<%end%>

<%= render :partial => 'excursions/scale_excursion_js', :locals => {:is_edit => true}%>

<script type="text/javascript">
  var VEconnected = false;
  window.onload = function(){
    VISH.IframeAPI.init({callback: onConnect});
  };
  function onConnect(origin){
    // console.log("Communication stablished with " + origin);
    VEconnected = true;
    VISH.IframeAPI.registerCallback("onVEFocusChange",function(focus,origin){
        if((focus===true)&&($('[data-toggle="dropdown"]').length>0)&&($('[data-toggle="dropdown"]').parent().hasClass('open'))){
          $('[data-toggle="dropdown"]').parent().removeClass('open');
        }
    });
  }
</script>


